﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;

namespace DataAccess
{
    public class RolesRepository : ConnectionClass
    {
        public RolesRepository() : base() { }

                public IQueryable<Role> GetUserRoles(string username)
        {
            //1. get the User which contains this username
            UsersRepository ur = new UsersRepository();
            User u = ur.GetUser(username);
            //2. get a list of roles of the returned user
            return new UsersRepository().GetUser(username).Roles.AsQueryable();
        } 
    }
}
